var queryTerms=null;

function parseForQueryTerms(term) {
	var ref = document.referrer.split('?');
	if (ref.length > 1) {
		var parms = ref[1].split('&');
		for (var i=0; i < parms.length; i++) {
			var pos = parms[i].indexOf('=');
			if (pos > 0) {
				if(term == parms[i].substring(0,pos))
					queryTerms  = parms[i].substring(pos+1);
			}
		}
	}
} 

if(document.referrer != '' && true) {

	if (document.referrer.indexOf('google.com') > -1){
		searchQueryVar = 'q';
		parseForQueryTerms(searchQueryVar);			
				
	} else if (document.referrer.indexOf('bing.com') > -1){
		searchQueryVar = 'q';
		parseForQueryTerms(searchQueryVar);			
	}			
	else if (document.referrer.indexOf('yahoo.com') > -1){
		searchQueryVar = 'p';
		parseForQueryTerms(searchQueryVar);			
					
	}
}

var placementUrl = "http://www.lduhtrp.net/cjx/placement/16005/120/240?keywords=gadget"

if(queryTerms != null) {
	if(placementUrl.indexOf('?') > 0)
		placementUrl = placementUrl + "&query=" + queryTerms
	else
		placementUrl = placementUrl + "?query=" + queryTerms
}



document.write("<IFRAME SRC='" + placementUrl + "'")
document.write("WIDTH='120'")
document.write("HEIGHT='240'")
document.write("FRAMEBORDER='0'")
document.write("MARGINWIDTH='0'")
document.write("MARGINHEIGHT='0'")
document.write("SCROLLING=\"no\"></iframe>")